/*
 * round.cpp
 *
 *  Created on: 2011-7-21
 *      Author: jfhu
 */

#include <stdio.h>
#include <memory.h>

const int MAX = 61;
char number[MAX] = {0};
int product[MAX] = {0};
bool stat[MAX][MAX];
// The length of the input digits sequence
int i;

bool multiply(char *num, int k)
{
	int carry = 0;
	for (int j = i - 1; j >= 0; --j)
	{
		int digit = num[j] - '0';
		digit = digit * k + carry;
		carry = digit / 10;
		digit %= 10;

		product[j] = digit;
	}

	if (carry != 0)
		return false;

	return true;
}

bool isCyclic(int k)
{
	int end = k, j = 0;
	do {
		if (product[j] != (number[k] - '0'))
			return false;
		++k;
		k %= i;
		++j;
	} while (k != end && j < i);
	return true;
}

void printfNumber()
{
	for (int j = 0; j < i; j++)
		printf("%d ", product[j]);
	printf("\n");
}

int main(int argc, char *argv[])
{
	while (scanf("%s", number) != EOF) {
		for (i = 0; number[i] != '\0'; i++) {
			stat[number[i] - '0'][i] = true;
		}

		int j;
		bool hasCyclic = true;
		for (j = 1; j <= i; j++) {
			if (!multiply(number, j)) {
				hasCyclic = false;
				break;
			}

			// Get the position list of the first digit of the product
			int k = 0;
			bool hasOne = false;
			while (k < i) {
				if (stat[product[0]][k]) {
					if (isCyclic(k)) {
						hasOne = true;
						break;
					}
				}
				++k;
			}

			if (!hasOne) {
				hasCyclic = false;
				break;
			}
		}

		if (!hasCyclic)
			printf("%s is not cyclic\n", number);
		else
			printf("%s is cyclic\n", number);
		memset(number, 0, MAX);
	}
	return 0;
}


